{% load staticfiles %}
{% load i18n %}
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}">
    <!-- Optional theme -->
    <link rel="stylesheet" href="{% static 'css/bootstrap-theme.min.css' %}">
    <!-- Blog CSS-->
    <link rel="stylesheet" href="{% static 'css/blog.css' %}">
    <link type="text/css" rel="stylesheet" href="{% static 'syntaxhighlighter/styles/shCoreDefault.css' %}"/>
    <script type="text/javascript" src="{% static 'syntaxhighlighter/scripts/shCore.js' %}"></script>
    <script type="text/javascript">SyntaxHighlighter.all();</script>
    <!-- Latest compiled and minified JavaScript -->
    <script src="{% static 'js/jquery-1.11.1.min.js' %}"></script>
    <script src="{% static 'js/base.js' %}"></script>
    <script src="{% static 'js/bootstrap.min.js' %}"></script>
    {% block header %}
    {% endblock %}
    <title>{% trans 'Simple Blog'%}</title>
</head>
<body class="customize-support">
<div class="page-header">
    {% if user.is_authenticated %}
        <a href="{% url 'post_new' %}" class="top-menu"><span
                class="glyphicon glyphicon-plus"></span></a>
        <a href="{% url 'post_draft_list' %}" class="top-menu"><span
                class="glyphicon glyphicon-edit"></span></a>
        <p class="top-menu" style="font-size: 15pt;">{% trans 'Hello'%} {{ user.username }}
            <small>&nbsp;</small>
            <a href="{% url 'django.contrib.auth.views.logout' %}" class="top-menu">
                <span class="glyphicon glyphicon-log-out"></span></a>
        </p>
    {% else %}
        <a href="{% url 'django.contrib.auth.views.login' %}" class="top-menu">
            <span class="glyphicon glyphicon-log-in"></span></a>
    {% endif %}
    <h1><a href="{% url 'blog.views.post_list' %}">{% trans 'Simple Blog'%}</a></h1>
</div>
<div id="navigation">
    <!-- menus START -->
    <ul id="menus">
        <li class="page_item">
            <a class="home" title="首页" href="{% url 'blog.views.post_list' %}">首页</a>
        </li>
        {% for pg in RECENT_PAGES %}
            <li class="page_item">
                <a href="{% url 'blog.views.page_detail' pk=pg.pk %}">{{ pg.title }}</a>
            </li>
        {% endfor %}
        <li><a class="lastmenu" href="javascript:void(0);"></a></li>
    </ul>
    <!-- menus END -->
    <!-- searchbox START -->
    <div id="searchbox">
        <form action="{% url 'blog.views.full_search' %}" method="get">
            <div class="content">
                <label>
                    <input type="text" class="textfield searchtip" name="q" size="24" value="">
                </label>
                <input type="submit" class="button" value="">
            </div>
        </form>
    </div>
    <script type="text/javascript">
        //<![CDATA[
        var searchbox = MGJS.$("searchbox");
        var searchtxt = MGJS.getElementsByClassName("textfield", "input", searchbox)[0];
        var searchbtn = MGJS.getElementsByClassName("button", "input", searchbox)[0];
        var tiptext = "请输入关键字...";
        if (searchtxt.value == "" || searchtxt.value == tiptext) {
            searchtxt.className += " searchtip";
            searchtxt.value = tiptext;
        }
        searchtxt.onfocus = function (e) {
            if (searchtxt.value == tiptext) {
                searchtxt.value = "";
                searchtxt.className = searchtxt.className.replace(" searchtip", "");
            }
        };
        searchtxt.onblur = function (e) {
            if (searchtxt.value == "") {
                searchtxt.className += " searchtip";
                searchtxt.value = tiptext;
            }
        };
        searchbtn.onclick = function (e) {
            if (searchtxt.value == "" || searchtxt.value == tiptext) {
                return false;
            }
        };
        //]]>
    </script>
    <!-- searchbox END -->
    <div class="fixed"></div>
</div>
<div class="row">
    <div class="col-md-1"></div>
    <div class="col-md-7" style="padding-right:18px;">
        {% block content %}
        {% endblock %}
    </div>
    <div class="col-md-3">
        <div id="sidebar">
            <!-- sidebar north START -->
            <div id="northsidebar" class="sidebar">
                <!-- showcase -->
                <div id="recent-posts-1" class="widget widget_recent_entries">
                    <h3>近期文章</h3>
                    <ul>
                        {% for recent_post in RECENT_POSTS %}
                            <li>
                                <a href="{% url 'blog.views.post_detail' pk=recent_post.pk %}">
                                    {{ recent_post.title }}
                                </a>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
                <div id="recent-comments-2" class="widget widget_recent_comments">
                    <h3>近期评论</h3>
                    <ul id="recentcomments">
                        {% for recent_comment in RECENT_COMMENTS %}
                            <li class="recentcomments">
                            <span>
                                {{ recent_comment.author }}:
                                <a href="{% url 'blog.views.post_detail' pk=recent_comment.post.id %}">
                                    {{ recent_comment.post.title }}
                                </a>
                            </span>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
                <div id="recent-posts-2" class="widget widget_recent_entries">
                    <h3>热门文章</h3>
                    <ul>
                        {% for hot_post in HOT_POSTS %}
                            <li>
                                <a href="{% url 'blog.views.post_detail' pk=hot_post.pk %}">
                                    {{ hot_post.title }}
                                </a>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
                <div id="tag_cloud-2" class="widget widget_tag_cloud">
                    <h3>标签</h3>
                    <div class="tagcloud">
                        {% for name, num, size in TAGS %}
                            <a href="{% url 'blog.views.post_list_by_tag' tag=name %}"
                               class="tag-link-20" title="{{ num }}个话题"
                               style="font-size: {{ size }}pt;">{{ name }}</a>
                        {% endfor %}
                    </div>
                </div>
                <div id="categories-2" class="widget widget_categories">
                    <h3>分类目录</h3>
                    <ul>
                        {% for ca in CATEGORIES %}
                            <li class="cat-item cat-item-10">
                                <a href="{% url 'blog.views.post_list_by_category' cg=ca.name %}"
                                   title="{{ ca.name }}">{{ ca.name }}</a>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
                <div id="archives-2" class="widget widget_archive">
                    <h3>文章归档</h3>
                    <ul>
                        {% for ar in ARCHIVES %}
                            <li>
                                <a href="{% url 'blog.views.post_list_by_ym' y=ar.year m=ar.month %}">
                                    {{ ar.year }}年{{ ar.month }}月</a>&nbsp;({{ ar.number }})
                            </li>
                        {% endfor %}
                    </ul>
                </div>
                <div id="meta-2" class="widget widget_meta">
                    <h3>功能</h3>
                    <ul>
                        {% if user.is_superuser %}
                        <li><a href="/xadmin">管理站点</a></li>
                        {% endif %}
                        {% if user.is_authenticated %}
                        <li>
                            <a href="{% url 'django.contrib.auth.views.logout' %}">登出</a>
                        </li>
                        {% else %}
                        <li>
                            <a href="{% url 'django.contrib.auth.views.login' %}">登录</a>
                        </li>
                        {% endif %}
                        <li><a href="#">文章<abbr title="RSS">RSS</abbr></a></li>
                    </ul>
                </div>
            </div>
            <!-- sidebar north END -->
        </div>
    </div>
    <div class="col-md-1"></div>
</div>

<div class="row">
    <div class="col-md-1"></div>
    <div class="col-md-10">
        <div id="footer">
            <a id="gotop" href="#" onclick="MGJS.goTop();return false;">回到顶部</a>

            <div id="copyright">版权所有 © 2014 <a href="http://yidao620c.github.io/">野猪林</a></div>
            <div id="themeinfo">页面设计由 <a href="http://yidao620c.github.io/">熊能</a> 提供, 通过
                <a href="http://validator.w3.org/check?uri=referer">XHTML 1.1</a>
                和 <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3">CSS 3</a>
                验证.
            </div>
        </div>
    </div>
</div>

<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushJScript.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushBash.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushPhp.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushJava.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushSql.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushXml.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushPython.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushCss.js' %}"></script>
<script class="javascript" src="{% static 'syntaxhighlighter/scripts/shBrushCpp.js' %}"></script>
</body>
</html>

